﻿using AppTemplate.UI.ViewModels;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace AppTemplate.UI.Framework
{
    public abstract partial class ViewModel : ObservableObject
    {
        public AppState App => AppState.Instance;

        public AsyncRelayCommand ViewLoadedCommand { get; set; }

        public ViewModel()
        {
            ViewLoadedCommand = new AsyncRelayCommand(OnViewLoaded);
        }

        protected virtual Task OnViewLoaded(CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        public bool IsLoaded { get; set; }
    }
}
